import axios from "@/utils/axios.js";

export default {
  getList(params) {
    return axios.get(`/api/v1/schoolInfo/query/list`, { params });
  },
  add(params) {
    return axios.post(`/api/v1/schoolInfo/insert`, params);
  },
  edit(params) {
    return axios.put(`/api/v1/schoolInfo/update`, params);
  },
  del(params) {
    return axios.delete(`/api/v1/schoolInfo/delete/${params.id}`);
  },
  getGis(params) {
    return axios.get(`/api/v1/schoolLocation/query/byName`, { params });
  },
  importFile(params,dsCode) {
    return axios.post(`/api/v1/upload/excel?dsCode=${dsCode}`, params, {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    });
  },
  downloadTemplate() {
    return axios.get('/api/v1/school/query', {
      responseType: 'blob'
    });
  }
};
